<script>
function factorial(number){
    var result = 1;
    for (var i=2; i<=number; i++){
        result *= i;
    }
    return result;
}

function C(n,r){
    return factorial(n)/(factorial(r)*factorial(n-r));
}

function main(){
    var result = 0;
    for (var n=1 ;n<=100; n++){
        for (var r=0; r<=n; r++){
            if (C(n,r)>1000000){
                result ++;
            }
        }
    }
    return result;
}

var timebgein = (new Date()).getTime();  
var result = main();
var timeend = (new Date()).getTime();  
alert(eval(timeend -timebgein));   
alert (result);


</script>